use crypto::{digest::Digest, md5::Md5};

pub struct Encrypt;

impl Encrypt {
    pub fn md5(text: String) -> String {
        let mut md5er = Md5::new();
        md5er.input_str(&text);
        md5er.result_str()
    }
    pub fn password_encrypt(password: String, salt: String) -> String {
        let text = format!("{}-{}",password,salt);
        Self::md5(text)
    }
}
